package com.lagou.utils;

import java.lang.reflect.Method;

public class StringUtils {
    /**
     * 根据方法名+方法返回值类型+方法参数类型获取该方法的唯一标识
     *
     * @param method
     * @return
     */
    public static String getMethodIndexByNameAndReturnTypeAndParameterTypes(Method method) {
        StringBuilder sb = new StringBuilder();
        sb.append(method.getName()).append(method.getReturnType());
        for (Class<?> parameterType : method.getParameterTypes()) {
            sb.append(parameterType.toString());
        }
        return sb.toString();
    }
}
